package com.qf.j2105.controller;

import com.qf.j2105.po.Addres;
import com.qf.j2105.service.AddresService;
import com.qf.j2105.vo.AdresVo;
import com.qf.j2105.vo.CheXiVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class AddresController {
    @Autowired
    private AddresService addresService;

    //查询地址
    @RequestMapping("/findaddres")
    @ResponseBody
    public List<Addres> findAddres() {
        List<Addres> address = addresService.findAddress();
        return address;
    }


    //查询车标
    @RequestMapping("/chebiao")
    @ResponseBody
    public List<AdresVo> findChebiao() {
        List<AdresVo> chebiao = addresService.findChebiao();
        System.out.println("chebiao = " + chebiao);
        return chebiao;
    }

    //查询车系

    @RequestMapping("/chexi")
    @ResponseBody
    public  List<CheXiVo> findChexi(String name){
        System.out.println("name = " + name);
        List<CheXiVo> chexi = addresService.findChexi(name);
        System.out.println("chexi = " + chexi);
        return  chexi;
    }


}
